<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: Low-Level</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__rtc__low__level__functions.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Low-Level<div class="ingroups"><a class="el" href="group__group__rtc.html">RTC          (Real-Time Clock)</a> &raquo; <a class="el" href="group__group__rtc__functions.html">Functions</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaefa2dfda62dd0bd93a020a5f3f109f55"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__rtc__low__level__functions.html#gaefa2dfda62dd0bd93a020a5f3f109f55">Cy_RTC_ConvertDayOfWeek</a> (uint32_t day, uint32_t month, uint32_t year)</td></tr>
<tr class="memdesc:gaefa2dfda62dd0bd93a020a5f3f109f55"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a day of the week for a year, month, and day of month that are passed through parameters.  <a href="#gaefa2dfda62dd0bd93a020a5f3f109f55">More...</a><br /></td></tr>
<tr class="separator:gaefa2dfda62dd0bd93a020a5f3f109f55"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7d79a94b5b584d933b012f11d34ac29e"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__rtc__low__level__functions.html#ga7d79a94b5b584d933b012f11d34ac29e">Cy_RTC_IsLeapYear</a> (uint32_t year)</td></tr>
<tr class="memdesc:ga7d79a94b5b584d933b012f11d34ac29e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks whether the year passed through the parameter is leap or not.  <a href="#ga7d79a94b5b584d933b012f11d34ac29e">More...</a><br /></td></tr>
<tr class="separator:ga7d79a94b5b584d933b012f11d34ac29e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaca23246d1ae0e7e6442215ef3d8ca068"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__rtc__low__level__functions.html#gaca23246d1ae0e7e6442215ef3d8ca068">Cy_RTC_DaysInMonth</a> (uint32_t month, uint32_t year)</td></tr>
<tr class="memdesc:gaca23246d1ae0e7e6442215ef3d8ca068"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a number of days in a month passed through the parameters.  <a href="#gaca23246d1ae0e7e6442215ef3d8ca068">More...</a><br /></td></tr>
<tr class="separator:gaca23246d1ae0e7e6442215ef3d8ca068"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf4ac08fe9e8eabc52d9f022cd3103e60"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__rtc__low__level__functions.html#gaf4ac08fe9e8eabc52d9f022cd3103e60">Cy_RTC_SyncFromRtc</a> (void)</td></tr>
<tr class="memdesc:gaf4ac08fe9e8eabc52d9f022cd3103e60"><td class="mdescLeft">&#160;</td><td class="mdescRight">The Synchronizer updates RTC values into AHB RTC user registers from the actual RTC.  <a href="#gaf4ac08fe9e8eabc52d9f022cd3103e60">More...</a><br /></td></tr>
<tr class="separator:gaf4ac08fe9e8eabc52d9f022cd3103e60"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8db7f22180c44fafceb083e2dcbf9555"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE <a class="el" href="group__group__rtc__enums.html#ga45a1b113f07f81bc369d7bf9da75eaae">cy_en_rtc_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__rtc__low__level__functions.html#ga8db7f22180c44fafceb083e2dcbf9555">Cy_RTC_WriteEnable</a> (<a class="el" href="group__group__rtc__enums.html#ga876952bea2bd3512cd8f523e00e38708">cy_en_rtc_write_status_t</a> writeEnable)</td></tr>
<tr class="memdesc:ga8db7f22180c44fafceb083e2dcbf9555"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set/Clear writeable option for RTC user registers.  <a href="#ga8db7f22180c44fafceb083e2dcbf9555">More...</a><br /></td></tr>
<tr class="separator:ga8db7f22180c44fafceb083e2dcbf9555"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab5b39e5ed5d0ce574633c7008f07d093"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__rtc__low__level__functions.html#gab5b39e5ed5d0ce574633c7008f07d093">Cy_RTC_GetSyncStatus</a> (void)</td></tr>
<tr class="memdesc:gab5b39e5ed5d0ce574633c7008f07d093"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return current status of CY_RTC_BUSY.  <a href="#gab5b39e5ed5d0ce574633c7008f07d093">More...</a><br /></td></tr>
<tr class="separator:gab5b39e5ed5d0ce574633c7008f07d093"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab52c64f8d94f511d74a9c420203b24a0"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE <a class="el" href="group__group__rtc__enums.html#ga40c0bfe67e6abf9f8807c8653de6a11b">cy_en_rtc_hours_format_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__rtc__low__level__functions.html#gab52c64f8d94f511d74a9c420203b24a0">Cy_RTC_GetHoursFormat</a> (void)</td></tr>
<tr class="memdesc:gab52c64f8d94f511d74a9c420203b24a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns current 12/24 hours format.  <a href="#gab52c64f8d94f511d74a9c420203b24a0">More...</a><br /></td></tr>
<tr class="separator:gab52c64f8d94f511d74a9c420203b24a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2180730a17231f562c6db1dda94ae5a6"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__rtc__low__level__functions.html#ga2180730a17231f562c6db1dda94ae5a6">Cy_RTC_IsExternalResetOccurred</a> (void)</td></tr>
<tr class="memdesc:ga2180730a17231f562c6db1dda94ae5a6"><td class="mdescLeft">&#160;</td><td class="mdescRight">The function checks the reset cause and returns the Boolean result.  <a href="#ga2180730a17231f562c6db1dda94ae5a6">More...</a><br /></td></tr>
<tr class="separator:ga2180730a17231f562c6db1dda94ae5a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga749c1f8be6f66b49d7e9205449ac3653"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__rtc__low__level__functions.html#ga749c1f8be6f66b49d7e9205449ac3653">Cy_RTC_SyncToRtcAhbDateAndTime</a> (uint32_t timeBcd, uint32_t dateBcd)</td></tr>
<tr class="memdesc:ga749c1f8be6f66b49d7e9205449ac3653"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function updates new time and date into the time and date RTC AHB registers.  <a href="#ga749c1f8be6f66b49d7e9205449ac3653">More...</a><br /></td></tr>
<tr class="separator:ga749c1f8be6f66b49d7e9205449ac3653"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaef65b4e1818b36e57229ee4ff7a83784"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__rtc__low__level__functions.html#gaef65b4e1818b36e57229ee4ff7a83784">Cy_RTC_SyncToRtcAhbAlarm</a> (uint32_t alarmTimeBcd, uint32_t alarmDateBcd, <a class="el" href="group__group__rtc__enums.html#gad3785b5ad8bf1b0d49cc5f639176db5f">cy_en_rtc_alarm_t</a> alarmIndex)</td></tr>
<tr class="memdesc:gaef65b4e1818b36e57229ee4ff7a83784"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function updates new alarm time and date into the alarm tire and date RTC AHB registers.  <a href="#gaef65b4e1818b36e57229ee4ff7a83784">More...</a><br /></td></tr>
<tr class="separator:gaef65b4e1818b36e57229ee4ff7a83784"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="gaefa2dfda62dd0bd93a020a5f3f109f55"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaefa2dfda62dd0bd93a020a5f3f109f55">&#9670;&nbsp;</a></span>Cy_RTC_ConvertDayOfWeek()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE uint32_t Cy_RTC_ConvertDayOfWeek </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>day</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>month</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>year</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns a day of the week for a year, month, and day of month that are passed through parameters. </p>
<p>Zeller's congruence is used to calculate the day of the week. RTC HW block does not provide the converting function for day of week. This function should be called before <a class="el" href="group__group__rtc__general__functions.html#ga47268d3ac315e0d41b4795362bc444a8" title="Sets the time and date values into the RTC_TIME and RTC_DATE registers. ">Cy_RTC_SetDateAndTime()</a> to get the day of week.</p>
<p>For the Georgian calendar, Zeller's congruence is: h = (q + [13 * (m + 1)] + K + [K/4] + [J/4] - 2J) mod 7</p>
<p>h - The day of the week (0 = Saturday, 1 = Sunday, 2 = Monday, ., 6 = Friday). q - The day of the month. m - The month (3 = March, 4 = April, 5 = May, ..., 14 = February) K - The year of the century (year mod 100). J - The zero-based century (actually [year/100]) For example, the zero-based centuries for 1995 and 2000 are 19 and 20 respectively (not to be confused with the common ordinal century enumeration which indicates 20th for both cases).</p>
<dl class="section note"><dt>Note</dt><dd>In this algorithm January and February are counted as months 13 and 14 of the previous year.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">day</td><td>The day of the month, Valid range 1..31.</td></tr>
    <tr><td class="paramname">month</td><td>The month of the year, see <a class="el" href="group__group__rtc__month.html">Month definitions</a>.</td></tr>
    <tr><td class="paramname">year</td><td>The year value. Valid range non-zero value.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a day of the week, see <a class="el" href="group__group__rtc__day__of__the__week.html">Day of the week definitions</a>. </dd></dl>

</div>
</div>
<a id="ga7d79a94b5b584d933b012f11d34ac29e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7d79a94b5b584d933b012f11d34ac29e">&#9670;&nbsp;</a></span>Cy_RTC_IsLeapYear()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE bool Cy_RTC_IsLeapYear </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>year</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Checks whether the year passed through the parameter is leap or not. </p>
<p>This API is for checking an invalid value input for leap year. RTC HW block does not provide a validation checker against time/date values, the valid range of days in Month should be checked before SetDateAndTime() function call. Leap year is identified as a year that is a multiple of 4 or 400 but not 100.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">year</td><td>The year to be checked. Valid range non-zero value.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>False - The year is not leap. True - The year is leap. </dd></dl>

</div>
</div>
<a id="gaca23246d1ae0e7e6442215ef3d8ca068"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaca23246d1ae0e7e6442215ef3d8ca068">&#9670;&nbsp;</a></span>Cy_RTC_DaysInMonth()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE uint32_t Cy_RTC_DaysInMonth </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>month</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>year</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns a number of days in a month passed through the parameters. </p>
<p>This API is for checking an invalid value input for days. RTC HW block does not provide a validation checker against time/date values, the valid range of days in Month should be checked before SetDateAndTime() function call.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">month</td><td>The month of the year, see <a class="el" href="group__group__rtc__month.html">Month definitions</a>.</td></tr>
    <tr><td class="paramname">year</td><td>A year value. Valid range non-zero value.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A number of days in a month in the year passed through the parameters. </dd></dl>

</div>
</div>
<a id="gaf4ac08fe9e8eabc52d9f022cd3103e60"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf4ac08fe9e8eabc52d9f022cd3103e60">&#9670;&nbsp;</a></span>Cy_RTC_SyncFromRtc()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_RTC_SyncFromRtc </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The Synchronizer updates RTC values into AHB RTC user registers from the actual RTC. </p>
<p>By calling this function, the actual RTC register values is copied to AHB user registers.</p>
<dl class="section note"><dt>Note</dt><dd>Only after calling <a class="el" href="group__group__rtc__low__level__functions.html#gaf4ac08fe9e8eabc52d9f022cd3103e60" title="The Synchronizer updates RTC values into AHB RTC user registers from the actual RTC. ">Cy_RTC_SyncFromRtc()</a>, the RTC time values can be read. After <a class="el" href="group__group__rtc__low__level__functions.html#gaf4ac08fe9e8eabc52d9f022cd3103e60" title="The Synchronizer updates RTC values into AHB RTC user registers from the actual RTC. ">Cy_RTC_SyncFromRtc()</a> calling the snapshot of the actual RTC registers are copied to the user registers. Meanwhile the RTC continues to clock. </dd></dl>

</div>
</div>
<a id="ga8db7f22180c44fafceb083e2dcbf9555"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8db7f22180c44fafceb083e2dcbf9555">&#9670;&nbsp;</a></span>Cy_RTC_WriteEnable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE <a class="el" href="group__group__rtc__enums.html#ga45a1b113f07f81bc369d7bf9da75eaae">cy_en_rtc_status_t</a> Cy_RTC_WriteEnable </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__rtc__enums.html#ga876952bea2bd3512cd8f523e00e38708">cy_en_rtc_write_status_t</a>&#160;</td>
          <td class="paramname"><em>writeEnable</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set/Clear writeable option for RTC user registers. </p>
<p>When the Write bit is set, data can be written into the RTC user registers. After all the RTC writes are done, the firmware must clear (call Cy_RTC_WriteEnable(RTC_WRITE_DISABLED)) the Write bit for the RTC update to take effect.</p>
<p>Set/Clear cannot be done if the RTC is still busy with a previous update (CY_RTC_BUSY = 1) or RTC Reading is executing.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">writeEnable</td><td>Write status, see <a class="el" href="group__group__rtc__enums.html#ga876952bea2bd3512cd8f523e00e38708">cy_en_rtc_write_status_t</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RTC_SUCCESS - Set/Clear Write bit was successful. CY_RTC_INVALID_STATE - RTC is busy with a previous update. See <a class="el" href="group__group__rtc__enums.html#ga45a1b113f07f81bc369d7bf9da75eaae">cy_en_rtc_status_t</a>. </dd></dl>

</div>
</div>
<a id="gab5b39e5ed5d0ce574633c7008f07d093"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab5b39e5ed5d0ce574633c7008f07d093">&#9670;&nbsp;</a></span>Cy_RTC_GetSyncStatus()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE uint32_t Cy_RTC_GetSyncStatus </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return current status of CY_RTC_BUSY. </p>
<p>The status indicates synchronization between the RTC user register and the actual RTC register. CY_RTC_BUSY bit is set if it is synchronizing. It is not possible to set the Read or Write bit until CY_RTC_BUSY clears.</p>
<dl class="section return"><dt>Returns</dt><dd>The status of RTC user register synchronization. See <a class="el" href="group__group__rtc__busy__status.html">RTC Status definitions</a> </dd></dl>

</div>
</div>
<a id="gab52c64f8d94f511d74a9c420203b24a0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab52c64f8d94f511d74a9c420203b24a0">&#9670;&nbsp;</a></span>Cy_RTC_GetHoursFormat()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE <a class="el" href="group__group__rtc__enums.html#ga40c0bfe67e6abf9f8807c8653de6a11b">cy_en_rtc_hours_format_t</a> Cy_RTC_GetHoursFormat </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns current 12/24 hours format. </p>
<dl class="section note"><dt>Note</dt><dd>Before getting the RTC current hours format, the <a class="el" href="group__group__rtc__low__level__functions.html#gaf4ac08fe9e8eabc52d9f022cd3103e60" title="The Synchronizer updates RTC values into AHB RTC user registers from the actual RTC. ">Cy_RTC_SyncFromRtc()</a> function should be called.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>The current RTC hours format. See <a class="el" href="group__group__rtc__enums.html#ga40c0bfe67e6abf9f8807c8653de6a11b">cy_en_rtc_hours_format_t</a>. </dd></dl>

</div>
</div>
<a id="ga2180730a17231f562c6db1dda94ae5a6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2180730a17231f562c6db1dda94ae5a6">&#9670;&nbsp;</a></span>Cy_RTC_IsExternalResetOccurred()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE bool Cy_RTC_IsExternalResetOccurred </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The function checks the reset cause and returns the Boolean result. </p>
<dl class="section return"><dt>Returns</dt><dd>True if the reset reason is the power cycle and the XRES (external reset). False if the reset reason is other than power cycle and the XRES.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>Based on a return value the RTC time and date can be updated or skipped after the device reset. For example, you should skip the <a class="el" href="group__group__rtc__alarm__functions.html#ga92807dc709c679c70c07d44cf0331a94" title="Sets alarm time and date values into the ALMx_TIME and ALMx_DATE registers. ">Cy_RTC_SetAlarmDateAndTime()</a> call function if internal WDT reset occurs. </dd></dl>

</div>
</div>
<a id="ga749c1f8be6f66b49d7e9205449ac3653"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga749c1f8be6f66b49d7e9205449ac3653">&#9670;&nbsp;</a></span>Cy_RTC_SyncToRtcAhbDateAndTime()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_RTC_SyncToRtcAhbDateAndTime </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>timeBcd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>dateBcd</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function updates new time and date into the time and date RTC AHB registers. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">timeBcd</td><td>The BCD-formatted time variable which has the same bit masks as the RTC_TIME register:</td></tr>
  </table>
  </dd>
</dl>
<p>[0:6] - Calendar seconds in BCD, the range 0-59. <br />
[14:8] - Calendar minutes in BCD, the range 0-59. <br />
[21:16] - Calendar hours in BCD, value depends on the 12/24-hour mode. <br />
12HR: [21]:0 = AM, 1 = PM, [20:16] = 1 - 12; <br />
24HR: [21:16] = 0-23. <br />
[22] - Selects the 12/24-hour mode: 1 - 12-hour, 0 - 24-hour. <br />
[26:24] - A calendar day of the week, the range 1 - 7, where 1 - Sunday. <br />
 </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dateBcd</td><td>The BCD-formatted time variable which has the same bit masks as the RTC_DATE register:</td></tr>
  </table>
  </dd>
</dl>
<p>[5:0] - A calendar day of a month in BCD, the range 1-31. <br />
[12:8] - A calendar month in BCD, the range 1-12. <br />
[23:16] - A calendar year in BCD, the range 0-99. <br />
 </p><dl class="section note"><dt>Note</dt><dd>Ensure that the parameters are presented in the BCD format. Use the ConstructTimeDate() function to construct BCD time and date values. Refer to ConstructTimeDate() function description for more details about the RTC_TIME and RTC_DATE bit fields format.</dd></dl>
<p>The RTC AHB registers can be updated only under condition that the Write bit is set and the RTC busy bit is cleared (RTC_BUSY = 0). Call the Cy_RTC_WriteEnable(CY_RTC_WRITE_ENABLED) and ensure that <a class="el" href="group__group__rtc__low__level__functions.html#ga8db7f22180c44fafceb083e2dcbf9555" title="Set/Clear writeable option for RTC user registers. ">Cy_RTC_WriteEnable()</a> returned CY_RTC_SUCCESS. Then you can call <a class="el" href="group__group__rtc__low__level__functions.html#ga749c1f8be6f66b49d7e9205449ac3653" title="This function updates new time and date into the time and date RTC AHB registers. ...">Cy_RTC_SyncToRtcAhbDateAndTime()</a>. Do not forget to clear the RTC Write bit to finish an RTC register update by calling Cy_RTC_WriteEnable(CY_RTC_WRITE_DISABLED) after you executed <a class="el" href="group__group__rtc__low__level__functions.html#ga749c1f8be6f66b49d7e9205449ac3653" title="This function updates new time and date into the time and date RTC AHB registers. ...">Cy_RTC_SyncToRtcAhbDateAndTime()</a>. Ensure that <a class="el" href="group__group__rtc__low__level__functions.html#ga8db7f22180c44fafceb083e2dcbf9555" title="Set/Clear writeable option for RTC user registers. ">Cy_RTC_WriteEnable()</a> returned CY_RTC_SUCCESS. </p>

</div>
</div>
<a id="gaef65b4e1818b36e57229ee4ff7a83784"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaef65b4e1818b36e57229ee4ff7a83784">&#9670;&nbsp;</a></span>Cy_RTC_SyncToRtcAhbAlarm()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_RTC_SyncToRtcAhbAlarm </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>alarmTimeBcd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>alarmDateBcd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__rtc__enums.html#gad3785b5ad8bf1b0d49cc5f639176db5f">cy_en_rtc_alarm_t</a>&#160;</td>
          <td class="paramname"><em>alarmIndex</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function updates new alarm time and date into the alarm tire and date RTC AHB registers. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">alarmTimeBcd</td><td>The BCD-formatted time variable which has the same bit masks as the ALMx_TIME register time fields:</td></tr>
  </table>
  </dd>
</dl>
<p>[0:6] - Alarm seconds in BCD, the range 0-59. <br />
[7] - Alarm seconds Enable: 0 - ignore, 1 - match. <br />
[14:8] - Alarm minutes in BCD, the range 0-59. <br />
[15] - Alarm minutes Enable: 0 - ignore, 1 - match. <br />
[21:16] - Alarm hours in BCD, value depending on the 12/24-hour mode (RTC_CTRL_12HR)<br />
12HR: [21]:0 = AM, 1 = PM, [20:16] = 1 - 12; <br />
24HR: [21:16] = the range 0-23. <br />
[23] - Alarm hours Enable: 0 - ignore, 1 - match. <br />
[26:24] - An alarm day of the week, the range 1 - 7, where 1 - Monday. <br />
[31] - An alarm day of the week Enable: 0 - ignore, 1 - match. <br />
 </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">alarmDateBcd</td><td>The BCD-formatted date variable which has the same bit masks as the ALMx_DATE register date fields: <br />
[5:0] - An alarm day of a month in BCD, the range 1-31. <br />
[7] - An alarm day of a month Enable: 0 - ignore, 1 - match. <br />
[12:8] - An alarm month in BCD, the range 1-12. <br />
[15] - An alarm month Enable: 0 - ignore, 1 - match. <br />
[31] - The Enable alarm: 0 - Alarm is disabled, 1 - Alarm is enabled. <br />
 </td></tr>
    <tr><td class="paramname">alarmIndex</td><td>The alarm index to be configured, see <a class="el" href="group__group__rtc__enums.html#gad3785b5ad8bf1b0d49cc5f639176db5f">cy_en_rtc_alarm_t</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Ensure that the parameters are presented in the BCD format. Use the ConstructTimeDate() function to construct BCD time and date values. Refer to ConstructTimeDate() function description for more details about the RTC ALMx_TIME and ALMx_DATE bit-fields format.</dd></dl>
<p>The RTC AHB registers can be updated only under condition that the Write bit is set and the RTC busy bit is cleared (RTC_BUSY = 0). Call the Cy_RTC_WriteEnable(CY_RTC_WRITE_ENABLED) and ensure that <a class="el" href="group__group__rtc__low__level__functions.html#ga8db7f22180c44fafceb083e2dcbf9555" title="Set/Clear writeable option for RTC user registers. ">Cy_RTC_WriteEnable()</a> returned CY_RTC_SUCCESS. Then you can call <a class="el" href="group__group__rtc__low__level__functions.html#ga749c1f8be6f66b49d7e9205449ac3653" title="This function updates new time and date into the time and date RTC AHB registers. ...">Cy_RTC_SyncToRtcAhbDateAndTime()</a>. Do not forget to clear the RTC Write bit to finish an RTC register update by calling the Cy_RTC_WriteEnable(CY_RTC_WRITE_DISABLED) after you executed <a class="el" href="group__group__rtc__low__level__functions.html#ga749c1f8be6f66b49d7e9205449ac3653" title="This function updates new time and date into the time and date RTC AHB registers. ...">Cy_RTC_SyncToRtcAhbDateAndTime()</a>. Ensure that <a class="el" href="group__group__rtc__low__level__functions.html#ga8db7f22180c44fafceb083e2dcbf9555" title="Set/Clear writeable option for RTC user registers. ">Cy_RTC_WriteEnable()</a> returned CY_RTC_SUCCESS. </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
